<?php

namespace GanYiInfo\HttpClient;

interface HttpClientInterface
{
    /**
     * Send request to the remote server
     *
     * Returns the result (Raw response from the server) on success, FALSE on failure
     *
     * @param string $uri
     * @param string $method
     * @param string $body
     * @param array $headers
     * @param int $timeout
     *
     * @return \GanYiInfo\Http\RawResponse
     */
    public function request($uri, $method = 'GET', $body = "", $headers = [], $timeout = 60);

    /**
     * Retriever the headers returned in the response
     *
     * @return array
     */
    public function getResponseHeader();

    /**
     * Returns latest request HTTP status code
     *
     * @return integer
     */
    public function getResponseHttpCode();

    /**
     * Returns latest error encountered by the client
     * This can be either a code or error message
     *
     * @return mixed
     */
    public function getResponseClientError();
}